package zyAll.zy2;

public class Computer {
    USB[] usb = new USB[5];
    int num;

    public void add(USB u){
        usb[num++] = u;
    }

    public void powerOn(){
        for (USB u:usb) {
            if (u != null)u.turnOn();
        }
        System.out.println("计算机开机成功...");
    }

    public void powerOff(){
        for (USB u:usb) {
            if (u != null)u.turnOff();
        }
        System.out.println("计算机关机成功...");
    }
}
